{extend name="../back" /}
{block name="main"}
<h6 class="fw-bold mb-3">{:lang('admin/link/index')}</h6>
<form action="{:dcUrl('admin/link/save')}" method="post">
<table class="table table-striped table-bordered table-hover" id="links">
  <thead>
    <tr>
      <th>删除</th>
      <th>显示排序</th>
      <th>站点名称</th>
      <th>站点URL</th>
      <th>文字说明（可选）</th>
      <th>LOGO地址（可选）</th>
      <th>启用</th>   
    </tr>
  </thead>
  <tbody>
    {volist name="list" id="item"}
    <tr class="align-middle">
      <td class="text-center"><input class="checkDelete" name="delete[]" type="checkbox" value="{$item.link_id}"></td>
      <td><input class="form-control form-control-sm" name="order[{$item.link_id}]" type="text" size="4" autocomplete="off" value="{$item.link_order}"></td>
      <td><input class="form-control form-control-sm" name="name[{$item.link_id}]" type="text" size="20" autocomplete="off" value="{$item.link_name}"></td>
      <td><input class="form-control form-control-sm" name="url[{$item.link_id}]" type="url" size="40" autocomplete="off" value="{$item.link_url}"></td>
      <td><input class="form-control form-control-sm" name="info[{$item.link_id}]" type="text" size="40" autocomplete="off" value="{$item.link_info}"></td>
      <td><input class="form-control form-control-sm" name="logo[{$item.link_id}]" type="text" size="40" autocomplete="off" value="{$item.link_logo}"></td>
      <td class="text-center"><input name="status[{$item.link_id}]" type="checkbox" value="1" {:dcBool($item['link_status'],'checked')}></td>
    </tr>
    {/volist}
    <tr class="align-middle d-none" id="plus-tr">
      <td class="text-center"></td>
      <td><input class="form-control form-control-sm" name="neworder[]" type="text" size="4" autocomplete="off" disabled required></td>
      <td><input class="form-control form-control-sm" name="newname[]" type="text" size="20" autocomplete="off" disabled required></td>
      <td><input class="form-control form-control-sm" name="newurl[]" type="url" size="40" autocomplete="off" disabled required></td>
      <td><input class="form-control form-control-sm" name="newinfo[]" type="text" size="40" autocomplete="off" disabled></td>
      <td><input class="form-control form-control-sm" name="newlogo[]" type="text" size="40" autocomplete="off" disabled></td>
      <td class="text-center"><input name="newstatus[]" type="checkbox" value="1" autocomplete="off" disabled checked></td>
    </tr>
    <tr>
      <td class="border-end-0"></td>
      <td class="border-start-0" colspan="6"><a class="fw-bold" href="javascript:;" id="plus" data-target="#plus-tr"><i class="iconfont icon-plus"></i>添加友情链接</a></td> 
    </tr>
 </tbody>
 <tfoot>
  <tr>
    <td class="text-center"><input id="checkAll" type="checkbox"></td>
    <td colspan="6"><button class="btn btn-dark btn-sm" type="submit">提交</button></td> 
  </tr>
 </tfoot>
</table>
</form>
{/block}